package com.lizb.scserviceconsumer.controller;

import com.lizb.scserviceconsumer.service.TestConfigService;
import com.lizb.scserviceconsumer.service.TestService;
import com.lizb.scserviceconsumer.service.TestZuulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private TestService testService;

    @Autowired
    private TestZuulService testZuulService;

    @Autowired
    private TestConfigService testConfigService;

    @RequestMapping(value = "/test/info/{testParam}" ,method = RequestMethod.GET)
    public String info(@PathVariable("testParam") String testParam) {
        return "调用服务结果：" + testService.hello(testParam);
    }

    @RequestMapping(value = "/test/info2/{testParam}" ,method = RequestMethod.GET)
    public String info2(@PathVariable("testParam") String testParam) {
        return "调用服务结果：" + testZuulService.hello(testParam);
    }

    @RequestMapping(value = "/test/info3" ,method = RequestMethod.GET)
    public String info3() {
        return "调用服务结果：" + testConfigService.hello();
    }
}
